Replication data & code for "Green party entry and conservative backlash: Evidence from Germany"

Below, we provide additional information regarding the replication code and data. The analysis in the paper were last ran on R 4.5.0.


1. Folder structure and further details

The replication code is designed to work with a specific folder structure, where all data files are stored inside a data/... directory. This structure must be maintained for the code to function properly. Otherwise, file paths in the code must be adapted. Please make sure the working directory is set to the one that contains both the code/... and data/... folders.
If one selects all files in the Dataverse, all choses to download them all in the original format, they are downloaded in this folder structure.

The file "main_script.R" allows one to run all code at once and provides further details. Please note that some parts (e.g., areal interpolation; bootstrapping) might be lengthier. 


2. Main dataset construction and analyses

Files 00_custom_functions.R through 14_fig_att_results.R in the folder code replicate the creation and processing of the election dataset as well as all the analyses with this dataset.


3. Survey analyses

The file 15_soep_appendix_table_c6_c7.R replicates the analyses using the SOEP data (Tables C6 and C7). 
The 16_survey1983.R replicates the analyses presented in section E of the Appendix, using the 1983 election survey.
The processed datasets for these analyses are in the data folder.


4. Cross-Country analyses
Finally, the file 17_crosscountry.R replicates the analyses across multiple countries, which we present in section F of the Appendix.
The processed datasets for these analyses are in the data folder.